package service;

import model.User;

import java.sql.SQLException;
import java.util.ArrayList;

public interface UserService {



    User getUserByID(int id) throws SQLException;

    public User getUserByName(String username) throws SQLException;

    public ArrayList<User> getAllUser(int pageIndex,int pageSize) throws SQLException;
    public int getUserCount() throws SQLException;

    public boolean doUpdate(User user);

    public boolean doDelete(int id);

    // 添加用户
    public boolean addUser(User user);
    // 添加搜索用户的方法，根据关键字搜索用户，并进行分页
    ArrayList<User> searchUser(String keyword, int pageIndex, int pageSize) throws SQLException;

    // 添加计算搜索结果数量的方法
    int countSearchUser(String keyword) throws SQLException;
}

